{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "iu6P8Pks-Y72"
      },
      "source": [
        "# Wrangling with Data 101 in Pixeltable\n",
        "\n",
        "\n",
        "In this tutorial, we'll guide you through using Pixeltable's intuitive table interface to handle common data wrangling tasks. We'll cover creating tables, populating them with data, querying them with various filters, and even performing basic transformations.\n",
        "\n",
        "#### Pixeltable simplifies data preparation with:\n",
        "\n",
        "- Unified Interface: Handle diverse data types (images, text, embeddings, time series) in a single table format.\n",
        "- Reproducibility: Track data lineage and changes, ensuring transparency and enabling you to retrace your steps.\n",
        "- Efficiency: Incremental updates mean you only recompute what's changed, saving valuable time and resources.\n",
        "\n",
        "#### See more examples for:\n",
        "\n",
        "- [Comparing Object Detection Models](https://dash.readme.com/project/pixeltable/v1.0/docs/object-detection-in-videos) (Computer Vision)\n",
        "- [Build a Q&A System in Minutes](https://pixeltable.readme.io/docs/build-a-qa-system-in-minutes-with-pixeltable) (LLM)\n",
        "- [Working with OpenAI](https://pixeltable.readme.io/docs/working-with-openai) (Integrations)\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "GwjjornhycHU",
        "outputId": "04aeb9ae-efdd-4d7f-ea04-7d8490f9f30d"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m247.3/247.3 kB\u001b[0m \u001b[31m3.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m34.3/34.3 MB\u001b[0m \u001b[31m18.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.4/54.4 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.0/48.0 kB\u001b[0m \u001b[31m2.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.2/59.2 kB\u001b[0m \u001b[31m1.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.3/11.3 MB\u001b[0m \u001b[31m23.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.0/3.0 MB\u001b[0m \u001b[31m10.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.5/3.5 MB\u001b[0m \u001b[31m22.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m819.3/819.3 kB\u001b[0m \u001b[31m24.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m15.7/15.7 MB\u001b[0m \u001b[31m53.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.7/12.7 MB\u001b[0m \u001b[31m58.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
            "ipython 7.34.0 requires jedi>=0.16, which is not installed.\n",
            "nbconvert 6.5.4 requires mistune<2,>=0.8.1, but you have mistune 3.0.2 which is incompatible.\u001b[0m\u001b[31m\n",
            "\u001b[0m"
          ]
        }
      ],
      "source": [
        "%pip install -q pixeltable"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "id": "EIBhrFB30cbF"
      },
      "outputs": [],
      "source": [
        "import pixeltable as pxt"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7StQcO-i-7NF"
      },
      "source": [
        "###  Creating and Populating Tables\n",
        "\n",
        "Pixeltable makes it easy to define tables with typed columns. Let's create a sample table to track information about things with wings and legs:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "UFRzCvtQ5Zr_",
        "outputId": "5c779121-3390-40a7-d6dd-6285bd159824"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Creating a Pixeltable instance at: /root/.pixeltable\n",
            "Connected to Pixeltable database at: postgresql://postgres:@/pixeltable?host=/root/.pixeltable/pgdata\n",
            "Created table `first_table`.\n",
            "Computing cells:   0%|                                                    | 0/3 [00:00<?, ? cells/s]\n",
            "Inserting rows into `first_table`: 3 rows [00:00, 477.95 rows/s]\n",
            "Computing cells: 100%|███████████████████████████████████████████| 3/3 [00:00<00:00, 121.35 cells/s]\n",
            "Inserted 3 rows with 0 errors.\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "UpdateStatus(num_rows=3, num_computed_values=3, num_excs=0, updated_cols=[], cols_with_excs=[])"
            ]
          },
          "metadata": {},
          "execution_count": 3
        }
      ],
      "source": [
        "# Drop the table if it already exists to avoid conflict\n",
        "pxt.drop_table('first_table', ignore_errors=True)\n",
        "\n",
        "t = pxt.create_table('first_table', {\n",
        "      'num_legs': pxt.IntType(nullable=True),\n",
        "      'num_wings': pxt.IntType(),\n",
        "      'name': pxt.StringType(nullable=True),\n",
        "      'image': pxt.ImageType(nullable=True)\n",
        "})\n",
        "\n",
        "# Insert rows (each row is a dictionary)\n",
        "t.insert([{'num_wings': 2, 'name': 'jake'},\n",
        "          {'num_legs': 3, 'num_wings': 2},\n",
        "          {'num_legs': 4, 'num_wings': 8, 'name': 'kev'}])"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "st_0PxiI_MFa"
      },
      "source": [
        "### Viewing and Filtering your Data with Queries\n",
        "\n",
        "Pixeltable offers convenient functions to inspect your data and filter rows based on specific criteria:"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# Show a specific row (e.g., row 1)\n",
        "# t.show(1)\n",
        "\n",
        "# Get all the rows as a list of dictionaries\n",
        "t.collect()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 143
        },
        "id": "u7Hvh8RSW1pr",
        "outputId": "8cf5ad61-413c-409f-922a-05859c72d919"
      },
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   num_legs  num_wings  name image\n",
              "0       NaN          2  jake  None\n",
              "1       3.0          2  None  None\n",
              "2       4.0          8   kev  None"
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>num_legs</th>\n",
              "      <th>num_wings</th>\n",
              "      <th>name</th>\n",
              "      <th>image</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>jake</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>3.0</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>4.0</td>\n",
              "      <td>8</td>\n",
              "      <td>kev</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 4
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 81
        },
        "id": "Sixa7YQxBWiE",
        "outputId": "0a9caf1b-856b-466d-eed0-458e69649d5b"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   num_legs  num_wings name image\n",
              "0         4          8  kev  None"
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>num_legs</th>\n",
              "      <th>num_wings</th>\n",
              "      <th>name</th>\n",
              "      <th>image</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>4</td>\n",
              "      <td>8</td>\n",
              "      <td>kev</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 5
        }
      ],
      "source": [
        "# Show rows where num_wings is greater than or equal to 7\n",
        "t.where(t.num_wings >= 7).show()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 143
        },
        "id": "zrAugZLt_1jV",
        "outputId": "e3b6ac3e-882f-4c90-ecf0-31f982d00018"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   num_legs  num_wings  name image\n",
              "0       NaN          2  jake  None\n",
              "1       3.0          2  None  None\n",
              "2       4.0          8   kev  None"
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>num_legs</th>\n",
              "      <th>num_wings</th>\n",
              "      <th>name</th>\n",
              "      <th>image</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>jake</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>3.0</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>4.0</td>\n",
              "      <td>8</td>\n",
              "      <td>kev</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 6
        }
      ],
      "source": [
        "# Filter on multiple values using 'isin'\n",
        "t.where(t.num_wings.isin([2, 8])).collect()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "jK9e2vLU_p-d"
      },
      "source": [
        "### Basic Column Transformations\n",
        "\n",
        "Pixeltable allows you to perform calculations directly on columns, creating new values on the fly:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 81
        },
        "id": "X1NzJOHVA7lD",
        "outputId": "e9e4f4d6-8df7-4892-ae2f-988ea6e2d199"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   leg_calc  wing_calc\n",
              "0        52         32"
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>leg_calc</th>\n",
              "      <th>wing_calc</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>52</td>\n",
              "      <td>32</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 7
        }
      ],
      "source": [
        "# Extract data based on calculated columns\n",
        "t.where(t.name == 'kev').select(leg_calc=t.num_legs + 4 * 12, wing_calc=t.num_wings * t.num_legs).show()"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "#### Transform image data to a new column using built-in functions\n",
        "\n",
        "This example image will be referencing a copy of the source image available in the Pixeltable github repo. But in practice, the images can come from anywhere: an S3 bucket or local file system."
      ],
      "metadata": {
        "id": "cuhHPA_8Yq7e"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# We are required to insert a new row by specifying `num_wings` as by default `nullable=False` when we defined the schema of our `first_table`\n",
        "t.insert([{'num_wings': 2, 'image':'https://raw.github.com/pixeltable/pixeltable/master/docs/source/data/images/000000000025.jpg'}])"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "tpHXVMjqZG94",
        "outputId": "93cb7ab7-7a5f-4f6c-c536-476778e0d9c3"
      },
      "execution_count": 8,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Computing cells: 100%|████████████████████████████████████████████| 1/1 [00:00<00:00,  1.45 cells/s]\n",
            "Inserting rows into `first_table`: 1 rows [00:00, 252.65 rows/s]\n",
            "Computing cells: 100%|████████████████████████████████████████████| 1/1 [00:00<00:00,  1.41 cells/s]\n",
            "Inserted 1 row with 0 errors.\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "UpdateStatus(num_rows=1, num_computed_values=1, num_excs=0, updated_cols=[], cols_with_excs=[])"
            ]
          },
          "metadata": {},
          "execution_count": 8
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "t.collect()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 322
        },
        "id": "QagmT82VZ1Mo",
        "outputId": "fc2291f8-52ab-494e-9ba2-1e97e1bfb70d"
      },
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   num_legs  num_wings  name  \\\n",
              "0       NaN          2  jake   \n",
              "1       3.0          2  None   \n",
              "2       4.0          8   kev   \n",
              "3       NaN          2  None   \n",
              "\n",
              "                                               image  \n",
              "0                                               None  \n",
              "1                                               None  \n",
              "2                                               None  \n",
              "3  <PIL.JpegImagePlugin.JpegImageFile image mode=...  "
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>num_legs</th>\n",
              "      <th>num_wings</th>\n",
              "      <th>name</th>\n",
              "      <th>image</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>jake</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>3.0</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>4.0</td>\n",
              "      <td>8</td>\n",
              "      <td>kev</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td><div class=\"pxt_image\" style=\"width:240px;\">\n",
              "                <img src=\"\" width=\"240\" />\n",
              "            </div></td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 9
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "t['transformed'] = t.image.rotate(45).resize((120, 120))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "HCsQ8s-maWPI",
        "outputId": "a2912a7c-bd18-4a12-98a5-c59ba4eadc3a"
      },
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Added 4 column values with 0 errors.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "t.show()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 402
        },
        "id": "fnUL9VSla6IS",
        "outputId": "c86ce04e-22c2-468f-c25f-855a5a3cf2dd"
      },
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   num_legs  num_wings  name  \\\n",
              "0       NaN          2  jake   \n",
              "1       3.0          2  None   \n",
              "2       4.0          8   kev   \n",
              "3       NaN          2  None   \n",
              "\n",
              "                                               image  \\\n",
              "0                                               None   \n",
              "1                                               None   \n",
              "2                                               None   \n",
              "3  <PIL.JpegImagePlugin.JpegImageFile image mode=...   \n",
              "\n",
              "                                         transformed  \n",
              "0                                               None  \n",
              "1                                               None  \n",
              "2                                               None  \n",
              "3  <PIL.Image.Image image mode=RGB size=120x120 a...  "
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>num_legs</th>\n",
              "      <th>num_wings</th>\n",
              "      <th>name</th>\n",
              "      <th>image</th>\n",
              "      <th>transformed</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>jake</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>3.0</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>4.0</td>\n",
              "      <td>8</td>\n",
              "      <td>kev</td>\n",
              "      <td>None</td>\n",
              "      <td>None</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>None</td>\n",
              "      <td><div class=\"pxt_image\" style=\"width:240px;\">\n",
              "                <img src=\"\" width=\"240\" />\n",
              "            </div></td>\n",
              "      <td><div class=\"pxt_image\" style=\"width:240px;\">\n",
              "                <img src=\"\" width=\"240\" />\n",
              "            </div></td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 11
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Real-World Example with Earthquake Data\n",
        "\n",
        "Let's start by creating a Pixeltable table from a Pandas dataframe\n",
        "\n",
        "`import_pandas`: This function streamlines the creation of a Pixeltable table from a Pandas DataFrame, inferring the column types automatically."
      ],
      "metadata": {
        "id": "5hQD8BW0XIpr"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import requests\n",
        "import pandas as pd\n",
        "\n",
        "# 1. Fetch Earthquake Data\n",
        "base_url = \"https://earthquake.usgs.gov/fdsnws/event/1/query?\"\n",
        "params = {\n",
        "    \"format\": \"geojson\",\n",
        "    \"starttime\": \"2023-01-01\",  # Start date of your interest\n",
        "    \"endtime\": \"2024-06-28\",  # End date\n",
        "    \"latitude\": 47.6062,      # Seattle's Latitude\n",
        "    \"longitude\": -122.3321,    # Seattle's Longitude\n",
        "    \"maxradiuskm\": 100       # Radius around Seattle\n",
        "}\n",
        "\n",
        "response = requests.get(base_url, params=params)\n",
        "data = response.json()\n",
        "\n",
        "# 2. Pandas DataFrame\n",
        "df = pd.json_normalize(data[\"features\"])\n",
        "df = df[[\"properties.mag\", \"properties.place\", \"properties.time\", \"geometry.coordinates\"]]\n",
        "df.columns = [\"magnitude\", \"location\", \"timestamp\", \"coordinates\"]\n",
        "\n",
        "# 3. Convert timestamp\n",
        "df[\"timestamp\"] = pd.to_datetime(df[\"timestamp\"], unit='ms')\n",
        "\n",
        "# 4. Extract Latitude and Longitude\n",
        "df['longitude'] = df['coordinates'].apply(lambda x: x[0])\n",
        "df['latitude'] = df['coordinates'].apply(lambda x: x[1])\n",
        "df = df.drop(\"coordinates\", axis=1)\n",
        "\n",
        "earthquake = pxt.io.import_pandas(\"eq_table\", df)\n",
        "earthquake.show()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 884
        },
        "id": "yEfHeCJmXEs8",
        "outputId": "a01f535b-4eec-49c2-dbc4-76b30ff00bdf"
      },
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Created table `eq_table`.\n",
            "Computing cells:   0%|                                                 | 0/1804 [00:00<?, ? cells/s]\n",
            "Inserting rows into `eq_table`: 0 rows [00:00, ? rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 241 rows [00:00, 2264.88 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 481 rows [00:00, 2303.36 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 721 rows [00:00, 2333.71 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 961 rows [00:00, 2314.55 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 1199 rows [00:00, 2336.98 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 1433 rows [00:00, 2337.00 rows/s]\u001b[A\n",
            "Inserting rows into `eq_table`: 1804 rows [00:00, 2276.79 rows/s]\n",
            "Computing cells: 100%|████████████████████████████████████| 1804/1804 [00:00<00:00, 2195.88 cells/s]\n",
            "Inserted 1804 rows with 0 errors.\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "    magnitude                              location               timestamp  \\\n",
              "0        0.14         7 km S of Seabeck, Washington 2024-06-27 23:45:29.670   \n",
              "1        0.46      13 km NNE of Ashford, Washington 2024-06-27 21:26:18.340   \n",
              "2        1.06      6 km NE of Fall City, Washington 2024-06-27 19:03:08.410   \n",
              "3        0.24      22 km ENE of Ashford, Washington 2024-06-27 14:07:02.800   \n",
              "4        1.66        10 km S of Seabeck, Washington 2024-06-27 10:33:50.370   \n",
              "5        0.57  6 km W of Lake Cavanaugh, Washington 2024-06-27 04:49:55.000   \n",
              "6        1.09         6 km NE of Duvall, Washington 2024-06-26 13:51:21.480   \n",
              "7        0.46      22 km ENE of Ashford, Washington 2024-06-26 13:38:50.670   \n",
              "8        0.00       12 km NE of Ashford, Washington 2024-06-26 06:33:16.760   \n",
              "9        0.53      22 km ENE of Ashford, Washington 2024-06-26 06:29:44.970   \n",
              "10       0.34       13 km NE of Ashford, Washington 2024-06-26 06:02:51.910   \n",
              "11       0.68     20 km NW of Hoodsport, Washington 2024-06-26 05:24:36.780   \n",
              "12       1.27          2 km S of Enetai, Washington 2024-06-25 18:09:00.720   \n",
              "13       1.47       2 km NE of Parkwood, Washington 2024-06-25 18:04:15.850   \n",
              "14       0.25        11 km E of Ashford, Washington 2024-06-25 05:18:31.290   \n",
              "15       0.20      15 km NNE of Ashford, Washington 2024-06-25 04:08:44.880   \n",
              "16       1.38      9 km W of Greenwater, Washington 2024-06-24 20:47:42.100   \n",
              "17       1.35        5 km E of Enumclaw, Washington 2024-06-24 20:13:06.930   \n",
              "18       2.61        7 km WNW of Lofall, Washington 2024-06-23 09:14:36.760   \n",
              "19       1.53      15 km NNE of Ashford, Washington 2024-06-23 01:02:05.760   \n",
              "\n",
              "     longitude   latitude  \n",
              "0  -122.830333  47.567667  \n",
              "1  -121.934500  46.864167  \n",
              "2  -121.826333  47.609833  \n",
              "3  -121.766667  46.853500  \n",
              "4  -122.848833  47.550167  \n",
              "5  -122.105667  48.322167  \n",
              "6  -121.919333  47.778500  \n",
              "7  -121.767833  46.847333  \n",
              "8  -121.921833  46.840667  \n",
              "9  -121.779333  46.859167  \n",
              "10 -121.911000  46.846833  \n",
              "11 -123.312500  47.543833  \n",
              "12 -122.593167  47.565500  \n",
              "13 -122.588833  47.546000  \n",
              "14 -121.878167  46.767667  \n",
              "15 -121.938667  46.881833  \n",
              "16 -121.781167  47.157333  \n",
              "17 -121.916833  47.210000  \n",
              "18 -122.747000  47.837167  \n",
              "19 -121.938667  46.881500  "
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>magnitude</th>\n",
              "      <th>location</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>longitude</th>\n",
              "      <th>latitude</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>0.14</td>\n",
              "      <td>7 km S of Seabeck, Washington</td>\n",
              "      <td>2024-06-27 23:45:29.670</td>\n",
              "      <td>-122.830333</td>\n",
              "      <td>47.567667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.46</td>\n",
              "      <td>13 km NNE of Ashford, Washington</td>\n",
              "      <td>2024-06-27 21:26:18.340</td>\n",
              "      <td>-121.934500</td>\n",
              "      <td>46.864167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.06</td>\n",
              "      <td>6 km NE of Fall City, Washington</td>\n",
              "      <td>2024-06-27 19:03:08.410</td>\n",
              "      <td>-121.826333</td>\n",
              "      <td>47.609833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.24</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-27 14:07:02.800</td>\n",
              "      <td>-121.766667</td>\n",
              "      <td>46.853500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.66</td>\n",
              "      <td>10 km S of Seabeck, Washington</td>\n",
              "      <td>2024-06-27 10:33:50.370</td>\n",
              "      <td>-122.848833</td>\n",
              "      <td>47.550167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.57</td>\n",
              "      <td>6 km W of Lake Cavanaugh, Washington</td>\n",
              "      <td>2024-06-27 04:49:55.000</td>\n",
              "      <td>-122.105667</td>\n",
              "      <td>48.322167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.09</td>\n",
              "      <td>6 km NE of Duvall, Washington</td>\n",
              "      <td>2024-06-26 13:51:21.480</td>\n",
              "      <td>-121.919333</td>\n",
              "      <td>47.778500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.46</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 13:38:50.670</td>\n",
              "      <td>-121.767833</td>\n",
              "      <td>46.847333</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.00</td>\n",
              "      <td>12 km NE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:33:16.760</td>\n",
              "      <td>-121.921833</td>\n",
              "      <td>46.840667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.53</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:29:44.970</td>\n",
              "      <td>-121.779333</td>\n",
              "      <td>46.859167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.34</td>\n",
              "      <td>13 km NE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:02:51.910</td>\n",
              "      <td>-121.911000</td>\n",
              "      <td>46.846833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.68</td>\n",
              "      <td>20 km NW of Hoodsport, Washington</td>\n",
              "      <td>2024-06-26 05:24:36.780</td>\n",
              "      <td>-123.312500</td>\n",
              "      <td>47.543833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.27</td>\n",
              "      <td>2 km S of Enetai, Washington</td>\n",
              "      <td>2024-06-25 18:09:00.720</td>\n",
              "      <td>-122.593167</td>\n",
              "      <td>47.565500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.47</td>\n",
              "      <td>2 km NE of Parkwood, Washington</td>\n",
              "      <td>2024-06-25 18:04:15.850</td>\n",
              "      <td>-122.588833</td>\n",
              "      <td>47.546000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.25</td>\n",
              "      <td>11 km E of Ashford, Washington</td>\n",
              "      <td>2024-06-25 05:18:31.290</td>\n",
              "      <td>-121.878167</td>\n",
              "      <td>46.767667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.20</td>\n",
              "      <td>15 km NNE of Ashford, Washington</td>\n",
              "      <td>2024-06-25 04:08:44.880</td>\n",
              "      <td>-121.938667</td>\n",
              "      <td>46.881833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.38</td>\n",
              "      <td>9 km W of Greenwater, Washington</td>\n",
              "      <td>2024-06-24 20:47:42.100</td>\n",
              "      <td>-121.781167</td>\n",
              "      <td>47.157333</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.35</td>\n",
              "      <td>5 km E of Enumclaw, Washington</td>\n",
              "      <td>2024-06-24 20:13:06.930</td>\n",
              "      <td>-121.916833</td>\n",
              "      <td>47.210000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>2.61</td>\n",
              "      <td>7 km WNW of Lofall, Washington</td>\n",
              "      <td>2024-06-23 09:14:36.760</td>\n",
              "      <td>-122.747000</td>\n",
              "      <td>47.837167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.53</td>\n",
              "      <td>15 km NNE of Ashford, Washington</td>\n",
              "      <td>2024-06-23 01:02:05.760</td>\n",
              "      <td>-121.938667</td>\n",
              "      <td>46.881500</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Filtering with Multiple Conditions (Logical Operators):"
      ],
      "metadata": {
        "id": "gNpnmk1nc-Z-"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "filtered_table = earthquake.where((earthquake.magnitude >= 1) & (earthquake.location == '22 km ENE of Ashford, Washington')).collect()\n",
        "filtered_table"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 269
        },
        "id": "171-VGx9c8cs",
        "outputId": "869fff7a-c3b6-4b76-f8a7-94d460cd33a9"
      },
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "   magnitude                          location               timestamp  \\\n",
              "0       1.41  22 km ENE of Ashford, Washington 2024-05-14 15:34:05.550   \n",
              "1       1.37  22 km ENE of Ashford, Washington 2024-04-26 13:31:03.580   \n",
              "2       1.07  22 km ENE of Ashford, Washington 2024-01-11 22:56:57.340   \n",
              "3       1.06  22 km ENE of Ashford, Washington 2023-10-28 12:56:05.460   \n",
              "4       1.13  22 km ENE of Ashford, Washington 2023-10-14 22:13:46.870   \n",
              "5       1.60  22 km ENE of Ashford, Washington 2023-04-29 05:39:06.970   \n",
              "6       1.44  22 km ENE of Ashford, Washington 2023-04-29 05:32:43.730   \n",
              "\n",
              "    longitude   latitude  \n",
              "0 -121.770333  46.853167  \n",
              "1 -121.765500  46.845500  \n",
              "2 -121.763833  46.852667  \n",
              "3 -121.758833  46.845167  \n",
              "4 -121.762833  46.851667  \n",
              "5 -121.763667  46.842333  \n",
              "6 -121.763500  46.845500  "
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>magnitude</th>\n",
              "      <th>location</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>longitude</th>\n",
              "      <th>latitude</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>1.41</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-05-14 15:34:05.550</td>\n",
              "      <td>-121.770333</td>\n",
              "      <td>46.853167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.37</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-04-26 13:31:03.580</td>\n",
              "      <td>-121.765500</td>\n",
              "      <td>46.845500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.07</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-01-11 22:56:57.340</td>\n",
              "      <td>-121.763833</td>\n",
              "      <td>46.852667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.06</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2023-10-28 12:56:05.460</td>\n",
              "      <td>-121.758833</td>\n",
              "      <td>46.845167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.13</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2023-10-14 22:13:46.870</td>\n",
              "      <td>-121.762833</td>\n",
              "      <td>46.851667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.60</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2023-04-29 05:39:06.970</td>\n",
              "      <td>-121.763667</td>\n",
              "      <td>46.842333</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.44</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2023-04-29 05:32:43.730</td>\n",
              "      <td>-121.763500</td>\n",
              "      <td>46.845500</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 13
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Creating Views\n",
        "You create a view by specifying a base table and defining either a filter or an iterator (or both)."
      ],
      "metadata": {
        "id": "6ETYVfrYhAXN"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "filtered_view = pxt.create_view('my_view', earthquake, filter=earthquake.timestamp >= '2024-06-25 18:09:00.720')"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "_f8Ce9JQg_pi",
        "outputId": "f9b7bf4d-835b-40b6-8aa0-d62a7434c6ac"
      },
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Inserting rows into `my_view`: 13 rows [00:00, 2111.20 rows/s]\n",
            "Created view `my_view` with 13 rows, 0 exceptions.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "filtered_view.show()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 457
        },
        "id": "CVxgsF83fIbA",
        "outputId": "8540d61f-1f0c-4dbb-c25d-e101467c9d80"
      },
      "execution_count": 15,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "    magnitude                              location               timestamp  \\\n",
              "0        0.14         7 km S of Seabeck, Washington 2024-06-27 23:45:29.670   \n",
              "1        0.46      13 km NNE of Ashford, Washington 2024-06-27 21:26:18.340   \n",
              "2        1.06      6 km NE of Fall City, Washington 2024-06-27 19:03:08.410   \n",
              "3        0.24      22 km ENE of Ashford, Washington 2024-06-27 14:07:02.800   \n",
              "4        1.66        10 km S of Seabeck, Washington 2024-06-27 10:33:50.370   \n",
              "5        0.57  6 km W of Lake Cavanaugh, Washington 2024-06-27 04:49:55.000   \n",
              "6        1.09         6 km NE of Duvall, Washington 2024-06-26 13:51:21.480   \n",
              "7        0.46      22 km ENE of Ashford, Washington 2024-06-26 13:38:50.670   \n",
              "8        0.00       12 km NE of Ashford, Washington 2024-06-26 06:33:16.760   \n",
              "9        0.53      22 km ENE of Ashford, Washington 2024-06-26 06:29:44.970   \n",
              "10       0.34       13 km NE of Ashford, Washington 2024-06-26 06:02:51.910   \n",
              "11       0.68     20 km NW of Hoodsport, Washington 2024-06-26 05:24:36.780   \n",
              "12       1.27          2 km S of Enetai, Washington 2024-06-25 18:09:00.720   \n",
              "\n",
              "     longitude   latitude  \n",
              "0  -122.830333  47.567667  \n",
              "1  -121.934500  46.864167  \n",
              "2  -121.826333  47.609833  \n",
              "3  -121.766667  46.853500  \n",
              "4  -122.848833  47.550167  \n",
              "5  -122.105667  48.322167  \n",
              "6  -121.919333  47.778500  \n",
              "7  -121.767833  46.847333  \n",
              "8  -121.921833  46.840667  \n",
              "9  -121.779333  46.859167  \n",
              "10 -121.911000  46.846833  \n",
              "11 -123.312500  47.543833  \n",
              "12 -122.593167  47.565500  "
            ],
            "text/html": [
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th>magnitude</th>\n",
              "      <th>location</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>longitude</th>\n",
              "      <th>latitude</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>0.14</td>\n",
              "      <td>7 km S of Seabeck, Washington</td>\n",
              "      <td>2024-06-27 23:45:29.670</td>\n",
              "      <td>-122.830333</td>\n",
              "      <td>47.567667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.46</td>\n",
              "      <td>13 km NNE of Ashford, Washington</td>\n",
              "      <td>2024-06-27 21:26:18.340</td>\n",
              "      <td>-121.934500</td>\n",
              "      <td>46.864167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.06</td>\n",
              "      <td>6 km NE of Fall City, Washington</td>\n",
              "      <td>2024-06-27 19:03:08.410</td>\n",
              "      <td>-121.826333</td>\n",
              "      <td>47.609833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.24</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-27 14:07:02.800</td>\n",
              "      <td>-121.766667</td>\n",
              "      <td>46.853500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.66</td>\n",
              "      <td>10 km S of Seabeck, Washington</td>\n",
              "      <td>2024-06-27 10:33:50.370</td>\n",
              "      <td>-122.848833</td>\n",
              "      <td>47.550167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.57</td>\n",
              "      <td>6 km W of Lake Cavanaugh, Washington</td>\n",
              "      <td>2024-06-27 04:49:55.000</td>\n",
              "      <td>-122.105667</td>\n",
              "      <td>48.322167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.09</td>\n",
              "      <td>6 km NE of Duvall, Washington</td>\n",
              "      <td>2024-06-26 13:51:21.480</td>\n",
              "      <td>-121.919333</td>\n",
              "      <td>47.778500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.46</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 13:38:50.670</td>\n",
              "      <td>-121.767833</td>\n",
              "      <td>46.847333</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.00</td>\n",
              "      <td>12 km NE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:33:16.760</td>\n",
              "      <td>-121.921833</td>\n",
              "      <td>46.840667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.53</td>\n",
              "      <td>22 km ENE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:29:44.970</td>\n",
              "      <td>-121.779333</td>\n",
              "      <td>46.859167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.34</td>\n",
              "      <td>13 km NE of Ashford, Washington</td>\n",
              "      <td>2024-06-26 06:02:51.910</td>\n",
              "      <td>-121.911000</td>\n",
              "      <td>46.846833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>0.68</td>\n",
              "      <td>20 km NW of Hoodsport, Washington</td>\n",
              "      <td>2024-06-26 05:24:36.780</td>\n",
              "      <td>-123.312500</td>\n",
              "      <td>47.543833</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1.27</td>\n",
              "      <td>2 km S of Enetai, Washington</td>\n",
              "      <td>2024-06-25 18:09:00.720</td>\n",
              "      <td>-122.593167</td>\n",
              "      <td>47.565500</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>"
            ]
          },
          "metadata": {},
          "execution_count": 15
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Views behave like regular tables within Pixeltable. You can:\n",
        "\n",
        "- Query Them: Apply filters, select specific columns, and perform calculations.\n",
        "- Update Them: (If not a snapshot view) Modify the underlying data, with changes automatically reflected in the view.\n",
        "- Chain Them: Create views on top of existing views for increasingly specific or complex transformations."
      ],
      "metadata": {
        "id": "QXeEo3LqiDDl"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Transition to Tables/Views Tutorial?"
      ],
      "metadata": {
        "id": "QkiUSobfcSr2"
      }
    }
  ],
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.10.13"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}